package com.syedu.day04.homework;

public class AmazingNumber {
    public static void main(String[] args) {
        print1();
        print2();
        print3();
    }

    public static void print1() {
        int start = 1, base = 8;
        for (int i = 1; i <= 9; i++) {
            System.out.println(start + "*" + base + "+" + i + "=" + (start * base + i));
            start *= 10;
            start += (i + 1);
        }
    }

    public static void print2() {
        int start = 1, base = 9;
        for (int i = 2; i <= 10; i++) {
            System.out.println(start + "*" + base + "+" + i + "=" + (start * base + i));
            start *= 10;
            start += i;
        }
    }

    public static void print3() {
        int start = 9, base = 9;
        for (int i = 7; i >= 0; i--) {
            System.out.println(start + "*" + base + "+" + i + "=" + (start * base + i));
            start *= 10;
            start += (i + 1);
        }
    }
}